package com.taocyb.constant.uc;

/**
 * 用户状态 
 */
public enum UserStatus {
	NORMAL(1, "正常"),
	FREEZE(2, "冻结");
	
	public final int key;
	public final String value;
	
	private UserStatus(int key, String value){
		this.key = key;
		this.value = value;
	}
	
	/**
	 * 根据key返回枚举对象
	 */
	public static UserStatus getEnum(int key){
		UserStatus[] objects = UserStatus.values();
		for(UserStatus obj : objects){
			if(obj.key == key){
				return obj;
			}
		}
		
		return null;
	}

	public int getKey() {
		return key;
	}

	public String getValue() {
		return value;
	}
}
